//
//  LogInViewController.m
//  理财师
//
//  Created by admin on 16/4/21.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "LogInViewController.h"
#import "LCSTextFild.h"
#import "UIButton+JGCustem.h"


@interface LogInViewController ()
{
    LCSTextFild *_telTextFild;
    LCSTextFild *_passTextFild;
}

@end

@implementation LogInViewController

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor redColor];
    
    
    UIImageView *backImg =[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_bg"]];
    [self.view addSubview:backImg];
    backImg.sd_layout.spaceToSuperView(UIEdgeInsetsMake(0, 0, 0, 0));
    UIImageView *iconImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"login_logo"]];
    
    UILabel *iconLbl = [[UILabel alloc] init];
    iconLbl.text = @"理财产品";
    iconLbl.textColor = [UIColor colorWithHexString:@"#CAC8C3"];
    iconLbl.textAlignment = NSTextAlignmentCenter;
    iconLbl.font = [UIFont systemFontOfSize:13.f];
    [self.view addSubview:iconLbl];

    _telTextFild =  [[LCSTextFild alloc] initWithPlaceHolder:@"请输入手机号" andBackGroudColor: [UIColor whiteColor]];
    _passTextFild = [[LCSTextFild alloc] initWithPlaceHolder:@"请输入手机号" andBackGroudColor: [UIColor whiteColor]];
    

    UIButton *logInBtn = [UIButton custemButton:@"登录" withTitleColor:[UIColor whiteColor] withBlackColor:[UIColor colorWithHexString:@"ffa9self00"] wihtTarget:self withAction:@selector(logIn) isCornerRadius:YES];
    UIButton *forgetBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    UIButton *registerBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [self.view sd_addSubviews:@[iconImg,_telTextFild,_passTextFild,logInBtn,forgetBtn,registerBtn]];
    
    iconImg.sd_layout.topSpaceToView(self.view,108).widthIs(64).heightIs(64).centerXEqualToView(self.view);
    iconLbl.sd_layout.topSpaceToView(iconImg,7).widthIs(64).heightIs(20).centerXEqualToView(self.view);
    _telTextFild.sd_layout.topSpaceToView(iconImg,74).leftSpaceToView(self.view,27).rightSpaceToView(self.view,27).heightIs(44);
    _passTextFild.sd_layout.topSpaceToView(_telTextFild,24).leftSpaceToView(self.view,27).rightSpaceToView(self.view,27).heightIs(44);
    forgetBtn.sd_layout.topSpaceToView(_passTextFild,12).rightSpaceToView(self.view,40).heightIs(44).widthIs(60);
    logInBtn.sd_layout.leftSpaceToView(self.view,27).topSpaceToView(_passTextFild,75).heightIs(44).rightSpaceToView(self.view,27);
    registerBtn.sd_layout.leftSpaceToView(self.view,27).topSpaceToView(logInBtn,10).heightIs(44).rightSpaceToView(self.view,27);
    
    iconImg.backgroundColor = [UIColor redColor];
    
    _telTextFild.textColor = [UIColor colorWithHexString:@"#9E9495"];
    _telTextFild.showClear = YES;
    
    _passTextFild.textColor = [UIColor colorWithHexString:@"#9E9495"];
    _passTextFild.showClear = YES;
    
    
    [forgetBtn setTitle:@"忘记密码" forState:UIControlStateNormal];
    [forgetBtn setTitleColor:[UIColor colorWithHexString:@"#CAC8C3"] forState:UIControlStateNormal];
    forgetBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
    [forgetBtn addTarget:self action:@selector(goForGetViewController) forControlEvents:UIControlEventTouchUpInside];
    
    [registerBtn setTitle:@"立即注册" forState:UIControlStateNormal];
    [registerBtn setTitleColor:[UIColor colorWithHexString:@"#CAC8C3"] forState:UIControlStateNormal];
    registerBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
    [registerBtn addTarget:self action:@selector(goRegisTerViewController) forControlEvents:UIControlEventTouchUpInside];

}


-(void)logIn
{
    
    
    
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
-(void)goForGetViewController
{
//    ForGetViewController *forg = [ForGetViewController new];
//    [self.navigationController pushViewController:forg animated:YES];
}
-(void)goRegisTerViewController
{
//    RegisterViewController *reg = [[RegisterViewController alloc] init];
//    [self.navigationController pushViewController:reg animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
